package org.codert.domain;

import javax.persistence.*;
import java.io.Serializable;

/**
 * @author: TanJingyu
 * @create: 2021-05-06 14:26
 **/
@Entity
@Table(name = "t_order")
public class Order {
    @EmbeddedId
    private OrderId id;

    private String orderName;


    public String getOrderName() {
        return orderName;
    }

    public void setOrderName(String orderName) {
        this.orderName = orderName;
    }

    public OrderId getId() {
        return id;
    }

    public void setId(OrderId id) {
        this.id = id;
    }

    @Embeddable
    public static class OrderId implements Serializable {
        private String shopId;
        private String userId;
        private String skuCode;

        public String getShopId() {
            return shopId;
        }

        public void setShopId(String shopId) {
            this.shopId = shopId;
        }

        public String getUserId() {
            return userId;
        }

        public void setUserId(String userId) {
            this.userId = userId;
        }

        public String getSkuCode() {
            return skuCode;
        }

        public void setSkuCode(String skuCode) {
            this.skuCode = skuCode;
        }
    }
}
